<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script src="${ctx}/scripts/jquery-1.11.3.js" ></script>
<link href="${ctx}/styles/bootstrap.css" type="text/css" rel="stylesheet">
<script src="${ctx}/scripts/bootstrap.js" type="text/javascript"></script>
<script src="${ctx}/scripts/application.js" type="text/javascript"></script>
<link href="${ctx}/styles/style.css" type="text/css" rel="stylesheet">
<script src="${ctx}/scripts/jquery-migrate-1.2.1.js" type="text/javascript"></script>
<link href="${ctx}/scripts/jquery-easyui-1.3.2/themes/default/easyui.css" type="text/css" rel="stylesheet">	
<link href="${ctx}/scripts/jquery-easyui-1.3.2/themes/icon.css"	type="text/css" rel="stylesheet">	
<script src="${ctx}/scripts/jquery-easyui-1.3.2/jquery.easyui.min.js" type="text/javascript"></script>
<script src="${ctx}/scripts/rest.js"></script>
<script src="<c:url value="/scripts/bootstrap-switch.js"/>" type="text/javascript"></script>
<link href="<c:url value="/styles/bootstrap-switch.css"/>" type="text/css" rel="stylesheet">
<link href="<c:url value="/widgets/simpletable/simpletable.css"/>"	type="text/css" rel="stylesheet">
<script type="text/javascript"	src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
<link href="<c:url value="/scripts/chosen/chosen.css"/>"	type="text/css" rel="stylesheet">
<script src="<c:url value="/scripts/chosen/chosen.jquery.min.js"/>"	type="text/javascript"></script>
<!--  -->
<script src="<c:url value="/scripts/bootstrap-datepicker.min.js"/>" type="text/javascript"></script>
<script src="<c:url value="/scripts/bootstrap-datepicker.zh-CN.min.js"/>" type="text/javascript"></script>
<link href="<c:url value="/styles/bootstrap-datepicker3.min.css"/>" type="text/css" rel="stylesheet">
<!--  -->
<link href="<c:url value="/scripts/jquery-easyui-1.3.2/themes/default/easyui.css"/>" type="text/css" rel="stylesheet">
<link href="<c:url value="/scripts/jquery-easyui-1.3.2/themes/icon.css"/>"	type="text/css" rel="stylesheet">
<script src="<c:url value="/scripts/jquery-easyui-1.3.2/jquery.easyui.min.js"/>" type="text/javascript"></script>
<script src="<c:url value="/scripts/validate_custom.js"/>" type="text/javascript"></script>
 	


<script type="text/javascript">
	$(function(){
	    var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
	    var b_version=navigator.appVersion;
	    if ( !isChrome ){
	    	$("span[id=sysTip]").text("请使用谷歌浏览器使用本系统!            ");
	    	return;
	   	   }
	    if(parseInt(b_version)< 4){
	    	$("span[id=sysTip]").text("使用的浏览器版本过低,请升级浏览器!          ");
	   	   }
	    
	  //初始化日期样式
	    $(".datepicker").datepicker({
	           language: "zh-CN",
	           autoclose: true,//选中之后自动隐藏日期选择框
	           clearBtn: true,//清除按钮
	           todayBtn:'linked',//今日按钮
	           format: "yyyy-mm-dd"//日期格式
	    });
	    
	    
	    });
	var num = meizhi = 0;//初始值 1:紧急
	  $(function(){
		 
	    $('li.link').hover(
		  function(){
			var nav = $('ul',this);
			nav.is(':animated')?nav.stop(true,true):null;//
			nav.delay(100).fadeIn(100);	//悬停延迟后展开导航
			},function(){
			    var nav = $('ul',this);
				nav.is(':animated')?null:nav.stop(true,true);	//离开时如果在动画中就取消队列,防止鼠标滑过就展开的bug
				nav.fadeOut(100);							//离开时收起导航
		});
		$('.txt').focusin(function(){
			$(this).css('border-color','#d3ac60');
		}).focusout(function(){
			$(this).css('border-color','#c2c2c2');
		});
	  });
	
	//密码强弱验证
	$(function(){
	$.extend($.fn.validatebox.defaults.rules, {
	    passLength:{
	    	validator:function (value) { 
	    	var meizhi = /[a-zA-Z]/g;
	    	var shazi = /\d/g;
	    	 $("#passwordTip").text("");
	    	if(meizhi.test(value)&&shazi.test(value)&&value.length>=6&&value.length<=20){
	            return true;  
	        }else {  
	    	 	$.fn.validatebox.defaults.rules.passLength.message = '密码必须包含是数字和字母，并且长度为 6~20';//密码必须包含是数字和字母，并且长度为 6~20';  
				return false;
	        }   
		  },message: ''  
	    }
	}); 
	$('#Editpassword').keyup(function () { 
		var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); 
		var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); 
		var enoughRegex = new RegExp("(?=.{6,}).*", "g");
		if (!enoughRegex.test($(this).val())) {
			$('#Editlevel').removeClass('pw-weak'); 
			$('#Editlevel').removeClass('pw-medium'); 
			$('#Editlevel').removeClass('pw-strong'); 
			$('#Editlevel').addClass(' pw-defule'); 
			 //密码小于六位的时候，密码强度图片都为灰色 
		} 
		else if (strongRegex.test($(this).val())) { 
			$('#Editlevel').removeClass('pw-weak'); 
			$('#Editlevel').removeClass('pw-medium'); 
			$('#Editlevel').removeClass('pw-strong'); 
			$('#Editlevel').addClass(' pw-strong'); 
			 //密码为八位及以上并且字母数字特殊字符三项都包括,强度最强 
		} 
		else if (mediumRegex.test($(this).val())) { 
			$('#Editlevel').removeClass('pw-weak'); 
			$('#Editlevel').removeClass('pw-medium'); 
			$('#Editlevel').removeClass('pw-strong'); 
			$('#Editlevel').addClass(' pw-medium'); 
			 //密码为七位及以上并且字母、数字、特殊字符三项中有两项，强度是中等 
		} 
		else { 
			$('#Editlevel').removeClass('pw-weak'); 
			$('#Editlevel').removeClass('pw-medium'); 
			$('#Editlevel').removeClass('pw-strong'); 
			$('#Editlevel').addClass('pw-weak'); 
			 //如果密码为6为及以下，就算字母、数字、特殊字符三项都包括，强度也是弱的 
		} 
		return true; 
	});
	})
	
	function editPassword(){
	$("#dalogCloseButton").removeAttr("data-dismiss");
	if(!$("#passwordModal").form('validate')){
		return false;
	}
	var password= $("input[id=Editpassword]").val();
	var validEditpassword= $("input[id=valid_Editpassword]").val();
	if(password!=validEditpassword){
		$("#passwordTip").text("两次输入不一致!");
		$("input[id=valid_Editpassword]").val("");
		return false;
	}
	$.ajax({
	    cache: true,
	     type: "POST",
	      url:"${ctx}/home/editPassword.do",
	     data:{password:password},
	    async: false,
	    error: function(request) {
	        	alert("Connection error");
	    },
	  success: function(data) {
		  if(data=="Sucess"){
			$("#passwordTip").text("密码修改成功!");
			$("#dalogCloseButton").attr("data-dismiss", "modal");
		  }else{
			  $("#passwordTip").text("密码修改失败请重试!");
		  }
	    }
	});
	} 
	function eliminateModal(){
	$("input[id=Editpassword]").val("");
	$("input[id=valid_Editpassword]").val("");
	$("#passwordTip").text("");
	
	$('#Editlevel').removeClass('pw-weak'); 
	$('#Editlevel').removeClass('pw-medium'); 
	$('#Editlevel').removeClass('pw-strong'); 
	$('#Editlevel').addClass(' pw-defule'); 
	}

</script>

<style>
<!--

 #EditPass {
	list-style: none;
	border: 1px solid #666;
	width: 100px;
	text-align: justify;
	position: absolute;
	top: 30px;
	left: -2px;
	background-color: #333;
	display: none;
	z-index: 1;
}

#mail {
	list-style: none;
	border: 1px solid #666;
	width: 130px;
	text-align: justify;
	position: absolute;
	top: 30px;
	left: -2px;
	background-color: #333;
	display: none;
	z-index: 1;
}

#mail_child {
	list-style: none;
	border: 1px solid #666;
	width: 200px;
	text-align: center;
	position: absolute;
	top: 0px;
	left: -200px;
	background-color: #333;
	z-index: 1;
	display: none;
}

#mail>li, #EditPass>li, #mail_child>li {
	padding: 0px;
	clear: both;
	background-image: url() !important;
	width: inherit;
}

#mail>li {
	text-align: center;
}

ul#toolbar>li:nth-child(1) {
	background-position: 100%;
	position: relative;
	padding: 0 20px;
}

#Li_Msg:hover #mail, ul#toolbar>li:nth-child(1):hover #EditPass,
	#mail_group:hover #mail_child {
	display: block;
}

#mail>li:hover, .link ul li:hover, #EditPass>li:hover {
	background: #ccc;
}

#mail>li a, #EditPass>li a {
	cursor: pointer;
	width: inherit;
	display: inline-block;
	text-indent: 12px;
	color: #fff;
}

#mail:after, #EditPass:after {
	display: table;
	clear: both;
	content: "";
}

#Li_Msg {
	background-position: 100% 4px;
	width: 40px;
	position: relative;
}

#circle {
	display: block;
	position: absolute;
	border-radius: 50%;
	color: #fff;
	z-index: 1;
	width: 8px;
	background-color: rgb(255, 0, 0);
	height: 8px;
	left: 23px;
	top: 8px;
}

#parities {
	position: absolute;
	top: 50%;
	left: 50%;
	color: #fff;
	margin-left: 76px;
}

#header {
	position: relative;
}

#parities .str {
	text-indent: 25px;
}

.grayButton {
	filter: Alpha(opacity = 10);
	-moz-opacity: .1;
	opacity: 0.4;
}

#mail>li a {
	display: inline;
}

/*语言下拉样式*/
.Language ul {
	border: 1px solid rgb(102, 102, 102);
	text-align: justify;
	background-color: rgb(51, 51, 51);
	padding: 5px;
	top: 29px;
}

.Language ul li a span {
	text-align: right;
	display: inline-block;
	width: 65px;
}

/* 密码效果CSS开始 */
.tbl-txt {
	font-size: 14px;
}

.tbl-txt input {
	padding: 0 5px;
	height: 22px;
	line-height: 22px;
	margin-bottom: 6px;
}

.pw-strength {
	clear: both;
	position: relative;
	top: 8px;
	width: 180px;
}

.pw-bar {
	background: url(${ctx}/images/pwd-check-xiaoguo1.png) no-repeat;
	position: relative;
	top: 6px;
	height: 22px;
	overflow: hidden;
	width: 179px;
}

.pw-bar-on {
	background: url(${ctx}/images/pwd-check-xiaoguo2.png) no-repeat;
	width: 0px;
	height: 22px;
	position: absolute;
	top: 7px;
	left: 2px;
	transition: width .5s ease-in;
	-moz-transition: width .5s ease-in;
	-webkit-transition: width .5s ease-in;
	-o-transition: width .5s ease-in;
}

.pw-weak .pw-defule {
	width: 0px;
}

.pw-weak .pw-bar-on {
	width: 60px;
}

.pw-medium .pw-bar-on {
	width: 120px;
}

.pw-strong .pw-bar-on {
	width: 179px;
}

.pw-txt {
	padding-top: 2px;
	width: 180px;
	overflow: hidden;
	position: relative;
	bottom: 14px;
}

.pw-txt span {
	color: #707070;
	float: left;
	font-size: 12px;
	text-align: center;
	width: 58px;
}
/* 密码效果CSS结束 */

-->
</style>